Skip to content

Warning mode, diagnostic collector, BuilderProblem enrichments - #12698

Draft
gnodet wants to merge 1 commit into
feature/console-modesfrom
feature/warning-mode
Draft

Warning mode, diagnostic collector, BuilderProblem enrichments#12698
gnodet wants to merge 1 commit into
feature/console-modesfrom
feature/warning-mode

Conversation

@gnodet

@gnodet gnodet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Part 4 of the logging feature chain. Depends on #12697 (console modes).

Adds --warning-mode CLI flag and structured diagnostic infrastructure:

  • --warning-mode=summary (default) — deduplicated warning summary at end of build
  • --warning-mode=all — inline warnings + summary
  • --warning-mode=none — suppress diagnostic summary
  • --warning-mode=fail — treat warnings as build errors

BuilderProblem API enrichments

  • getKey() — stable deduplication key for cross-module dedup
  • getSuggestion() — actionable fix suggestion
  • getDocumentationUrl() — link to relevant docs
  • INFO severity level added to Severity enum
  • BuilderProblem.builder() — fluent builder API with DefaultProblem record

New service API

  • DiagnosticReporter@Inject-able service for plugins to report structured problems

Internal infrastructure

  • DefaultDiagnosticCollector — thread-safe, deduplicating problem store with suppression support
  • DefaultDiagnosticReporter / DefaultDiagnosticSummary — wiring
  • BuildReportCollector upgraded to use DefaultDiagnosticCollector, auto-collect WARN log events, print summary

Files changed (16 files, ~1600 insertions)

Area Files
API BuilderProblem enrichments, DiagnosticReporter, Options (+warningMode())
CLI wiring CommonsCliOptions, LayeredOptions, MavenInvoker
Collector BuildReportCollector (full diagnostic integration), BuildReportJsonWriter (problem enrichments)
Internal DefaultDiagnosticCollector, DefaultDiagnosticReporter, DefaultDiagnosticSummary
Impl DefaultBuilderProblem (key/suggestion/url fields)
Tests 4 test classes updated + 1 new (DefaultDiagnosticCollectorTest)

PR chain

# PR Feature
1 #12694 Logging foundation
2 #12695 Build report
3 #12697 Console modes
4 This PR Warning mode + diagnostics
5 #12699 mvnlog viewer
#12702 Structured problems pipeline

Test plan

  • mvn test -pl impl/maven-core — all tests pass
  • mvn test -pl impl/maven-cli — all 692+ tests pass
  • CI validation

🤖 Generated with Claude Code

@gnodet
gnodet force-pushed the feature/console-modes branch from b0617f7 to 1a419b7 Compare August 8, 2026 01:23
@gnodet
gnodet force-pushed the feature/warning-mode branch from 0cc76eb to 6124231 Compare August 8, 2026 01:23
gnodet added a commit that referenced this pull request Aug 8, 2026
Add the mvnlog tool for viewing and analyzing build-report JSON files.
Includes BuildReportRenderer for human-readable output, SimpleJsonReader
for dependency-free JSON parsing, shell scripts (mvnlog/mvnlog.cmd),
and --log routing in mvn/mvn.cmd. Also adds integration tests for
build report generation, console modes, and the mvnlog viewer, plus
--console=verbose flags for ITs that depend on verbose output.

Part 5 of the #12572 split (depends on warning mode PR #12698).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add --warning-mode CLI flag (summary/all/none/fail) for controlling
how build warnings are displayed. Enrich BuilderProblem with key,
suggestion, documentationUrl, INFO severity, and a builder API.
Add DiagnosticReporter service and DefaultDiagnosticCollector for
deduplication across parallel module builds.

Part 4 of the #12572 split (depends on console modes PR #12697).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet added a commit that referenced this pull request Aug 8, 2026
Add the mvnlog tool for viewing and analyzing build-report JSON files.
Includes BuildReportRenderer for human-readable output, SimpleJsonReader
for dependency-free JSON parsing, shell scripts (mvnlog/mvnlog.cmd),
and --log routing in mvn/mvn.cmd. Also adds integration tests for
build report generation, console modes, and the mvnlog viewer, plus
--console=verbose flags for ITs that depend on verbose output.

Part 5 of the #12572 split (depends on warning mode PR #12698).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet force-pushed the feature/warning-mode branch from 6124231 to dc3bccd Compare August 8, 2026 05:35
@gnodet
gnodet force-pushed the feature/console-modes branch from 1a419b7 to 1e4c616 Compare August 8, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant